
import store from '@/store'
// 获取
const getToken = () => store.state.user.token
// 存储
const setToken = (tokenStr) => {
  store.commit('user/setToken', tokenStr)
}
// 删除
const removeToken = () => {
  // 传一个空的字符串
  store.commit('user/setToken', '')
}
const getRefreshToken = () => store.state.user.refreshToken

const setRefreshToken = (refreshTokenStr) => {
  store.commit('user/setRefreshToken', refreshTokenStr)
}
const removeRefreshToken = () => {
  // 传一个空的字符串
  store.commit('user/setRefreshToken', '')
}
export {
  getToken,
  setToken,
  removeToken,
  getRefreshToken,
  setRefreshToken,
  removeRefreshToken
}
